package expression.v1.dao;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

@Repository
public class BaseDao<T> implements IBaseDao<T>{

	@Autowired
	@Qualifier("jdbcTemplate")
	private JdbcTemplate jdbcTemplate;
	
	public JdbcTemplate getJdbcTemplate() {
		return jdbcTemplate;
	}

	public void setJdbcTemplate(JdbcTemplate jdbcTemplate) {
		this.jdbcTemplate = jdbcTemplate;
	}

	@Override
	public int add(String sql,T t) {
		return jdbcTemplate.update(sql, t);
	}

	@Override
	public int addBatch(String sql,List<T> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int update(String sql,T t) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int updateBatch(String sql,List<T> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int delete(String sql,T t) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public int deleteBatch(String sql,List<T> list) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public T queryById(String sql,String id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public T queryByName(String sql,String name) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public List<T> queryLike(String sql,String like) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public int countAll(){
		return 0;
	}

	@Override
	public int countByConditions(Object... args) {
		// TODO Auto-generated method stub
		return 0;
	}
}
